import request from '@/config/axios'

// 用户留言板 VO
export interface MessageBoardVO {
  id: number // 主键
  sendId: number // 发送者id
  receiveId: number // 接收者id
  content: string // 留言内容
  isRead: number // 是否已读 1是2否
}

// 用户留言板 API
export const MessageBoardApi = {
  // 查询用户留言板分页
  getMessageBoardPage: async (params: any) => {
    return await request.get({ url: `/wine/message-board/page`, params })
  },

  // 查询用户留言板详情
  getMessageBoard: async (id: number) => {
    return await request.get({ url: `/wine/message-board/get?id=` + id })
  },

  // 新增用户留言板
  createMessageBoard: async (data: MessageBoardVO) => {
    return await request.post({ url: `/wine/message-board/create`, data })
  },

  // 修改用户留言板
  updateMessageBoard: async (data: MessageBoardVO) => {
    return await request.put({ url: `/wine/message-board/update`, data })
  },

  // 删除用户留言板
  deleteMessageBoard: async (id: number) => {
    return await request.delete({ url: `/wine/message-board/delete?id=` + id })
  },

  // 导出用户留言板 Excel
  exportMessageBoard: async (params) => {
    return await request.download({ url: `/wine/message-board/export-excel`, params })
  }
}